package com.huluobo.a2204parkdemo.park

import android.content.Intent
import android.graphics.BitmapFactory
import android.util.Log
import android.view.View
import com.google.vr.sdk.widgets.pano.VrPanoramaView
import com.huluobo.a2204parkdemo.R
import com.huluobo.a2204parkdemo.databinding.ActivityParkingVractivityBinding
import com.huluobo.base.bean.MonthSignBeanItem
import com.huluobo.base.bean.ParkingBeanItem
import com.huluobo.base.mvvm.BaseActivity
import com.huluobo.base.net.Const
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class ParkingVRActivity : BaseActivity<ActivityParkingVractivityBinding, ParkViewModel>() {
    private lateinit var parkBeanItem: ParkingBeanItem
    override fun initData() {
        parkBeanItem = intent.getSerializableExtra(Const.INTENT_PARK_BEAN) as ParkingBeanItem
    }

    override fun initView() {
        val option = VrPanoramaView.Options()
        option.inputType = VrPanoramaView.Options.TYPE_MONO //设置水平轴360度旋转
        binding.vrView.loadImageFromBitmap(BitmapFactory.decodeResource(resources, R.drawable.ddd), option)

        binding.parkingVrHeader.headerTitle.text = "车位预览"
        binding.parkingVrHeader.headerBack.setOnClickListener { finish() }
        binding.parkingVrHeader.headerAdd.visibility = View.VISIBLE
        binding.parkingVrHeader.headerAdd.setOnClickListener {
            val intent = Intent(this, ParkingValueActivity::class.java)
            intent.putExtra(Const.INTENT_PARK_BEAN, parkBeanItem)
            startActivity(intent)
            finish()
        }
    }


}